from alive_progress import alive_bar
import time

tasks = 100  # 总任务数
with alive_bar(tasks, force_tty=True) as bar:  # 设置任务总数
    for i in range(tasks):
        print('1')
        time.sleep(0.1)
        bar()  # 更新进度条